import sys
import os
from glob import glob

root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(root)

data = os.path.join(root,"datasets")

def get_images_list():
    blur = os.path.join(data,"blur")
    images = os.path.join(blur,"images")

    with open(os.path.join(blur,"images_list.txt"),"w") as op:
        clear_images = glob(os.path.join(images,"0","*.JPG"))

        for image in clear_images:
            op.write("{} {}\n".format(image,"0"))

        blur_images = glob(os.path.join(images, "1", "*.JPG"))

        for image in blur_images:
            op.write("{} {}\n".format(image, "1"))

get_images_list()